package com.coffee.core.enums;

public enum DeliveryWayEnum {
    FREESHIPPING("包邮", "包邮"),
    FULLREDUCTION("满减", "满减"),
    PAYONARRIVAL("到付", "到付"),
    PAYMENT("付费", "付费");

    private String code;
    private String name;

    private DeliveryWayEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static DeliveryWayEnum getByCode(String code) {
        for (DeliveryWayEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }

        return null;
    }
}
